home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970626-19970929
/
000212_news@newsmaster….columbia.edu _Thu Aug 21 20:14:54 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
5KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id UAA17520
for <kermit.misc@watsun.cc.columbia.edu>; Thu, 21 Aug 1997 20:14:53 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id UAA02802
for kermit.misc@watsun; Thu, 21 Aug 1997 20:14:53 -0400 (EDT)
Path: news.columbia.edu!panix!howland.erols.net!infeed2.internetmci.com!newsfeed.internetmci.com!207.49.14.4!news.wolsi.com!news.aros.net!news.cs.utah.edu!cc.usu.edu!jrd
From: jrd@cc.usu.edu (Joe Doupnik)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: echo command works differently between 3.14 and 3.15
Message-ID: <KM7xYazirna0@cc.usu.edu>
Date: 21 Aug 97 16:56:12 MDT
References: <33f9b133.266082@news.calvacom.fr> <PYDViO7VXbx1@cc.usu.edu>
Organization: Utah State University
Lines: 95
Xref: news.columbia.edu comp.protocols.kermit.misc:7527
In article <PYDViO7VXbx1@cc.usu.edu>, jrd@cc.usu.edu (Joe Doupnik) writes:
> In article <33f9b133.266082@news.calvacom.fr>, do11@calva.net (Dominique Ottello) writes:
>> Hello from France.
>>
>> I apologize for my wrong English. I hope you understand me.
>>
>> I think there is a problem with echo command within a take file between
>> MS-DOS Kermit 3.14 and 3.15 beta 21
>>
>> With MS-DOS Kermit 3.14 both the macro Disp and the echo command will
>> display "Yes" in green (With ANSI.SYS loaded).
>>
>> With MS-DOS Kermit 3.15 only the macro Disp displays "Yes" in green.
>> Echo command displays the contents of macro's Ge and No.
>> ANSI escape sequences are not correctly executed when these sequences are
>> within a macro inside an echo command.
>> (See macro and commands hereunder)
>>
>> ; Displays White on Blue
>> assign No \27[0;1;37;44m
>> ; Displays Green on Blue
>> assign Ge \27[0;1;32;44m
>> assign Disp echo {From Macro Disp : \m(Ge)Yes\m(No)}
>> Disp
>> echo {From Echo Command : \m(Ge)Yes\m(No)}
>>
> ---------
> Translating this into words for other readers, ASSIGN evaluates
> its arguments before storing the result into the named variable. DEFINE
> does not. Neither changes \numbers to binary form.
> Next, processing \m(macro-name) is a parallel process to reducing
> \numbers, not an iterative one. That's the key here.
> Macro DISP receives argument
> echo {From Macro Disp: \27[0;1;32;44mYes\27[0;1;37;44m}
> where the \m(macro-name) parts have had their contents substituted.
> Invoking macro DISP causes the above string to be passed through the parser
> again by the ECHO command, and ECHO asks for \numbers to be converted to
> binary format.
> Then the single ECHO command below it sees not that \number style
> string but rather \m(macro-name) string, \m(name) items are parsed to their
> replacment text, and thus ECHO sees literal \27[ etc characters. \number and
> \m(name) are parallel but not self-calling in MSK 3.15. Thus we see \27[ etc
> on the screen.
> Or in simpler terms, \numbers are not substitution variables.
> MSK 3.14 did \number conversion in individual commands such as ECHO,
> and hence in series with substitution variable work by the parser, but MSK
> 3.15 moved \num conversion into the parser in parallel with substitution
> variables.
----------
Adding what I should have done in the above message: how to work
around this effect.
The solution is to use formal substitution variables, \%letter items.
Then a test Take file might be like this:
; Displays White on Blue
assign No \27[0;1;37;44m
; Displays Green on Blue
assign Ge \27[0;1;32;44m
assign Disp echo {From Macro Disp : \m(Ge)Yes\m(No)}
Disp
echo {From Echo Command : \m(Ge)Yes\m(No)}
; variable format
echo Variable form
assign \%n \27[0;1;37;44m
; Displays Green on Blue
assign \%g \27[0;1;32;44m
assign Disp echo {From Macro Disp : \%gYes\%n}
Disp
echo {From Echo Command : \%gYes\%n}
The second, variable, format works as desired: a green Yes is
displayed by both DISP and ECHO command lines. The reason it works is
because formal substitution variables reevaluate their results recursively,
thus the parser sees \%g, replaces it by \27[ etc and then reevalutes the
string from the \ byte again (and hence sees \27 as a \number to be
reduced to binary).
Recall, \m(ge) is replaced by the macro ge's definition and that's
that. The definition is not rescanned for \number conversion. Similarly,
def A this is short
def b \m(a)
def c \m(b)
echo testing \m(c)
yields "testing \m(b)" rather than "testing this is short".
But
def \%a this is short
def \%b \%a
def \%c \%b
echo testing \%c
yields "testing this is short", \%a is "this is short", \%b is "\%a",
and \%c is "\%b". Substitution variables reevalute themselves and we get
down to the bare "this is short" definition in the end.
Cynics may say this is the Computer Science equivalent of lawyer-speak.
I couldn't possible comment on that, unquote.
Joe D.